package io.renren.modules.model.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;
import io.renren.modules.model.dao.ModelBindRelationDao;
import io.renren.modules.model.entity.ModelBindRelationEntity;
import io.renren.modules.model.service.ModelBindRelationService;


@Service("modelBindRelationService")
public class ModelBindRelationServiceImpl extends ServiceImpl<ModelBindRelationDao, ModelBindRelationEntity> implements ModelBindRelationService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<ModelBindRelationEntity> page = this.selectPage(
                new Query<ModelBindRelationEntity>(params).getPage(),
                new EntityWrapper<ModelBindRelationEntity>()
        );

        return new PageUtils(page);
    }
    
    /**
     * 根据 model分组的ids，查询 所有有 绑定 的关系
     */
    @Override
    public List<ModelBindRelationEntity> queryBindRelation(Long[] modelIds){
    	return baseMapper.queryBindRelation(modelIds);
    }

}
